package com.shop.dao;

import com.shop.bean.*;
import com.shop.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {

    User getUserByUsername(@Param("username") String username);

    int userRegister(@Param("user") User user);

    User getUserByID(@Param("id") Integer id);

    int editUser(@Param("user")User user);

    int add(@Param("user")User user);

    int changePassword(@Param("id")Integer id,@Param("newpassword") String newpassword);

    int deleteUser(@Param("id")Integer id);

    int reloadPassword(@Param("id")Integer id,@Param("password")String password);

    int getCount(String text);

    List<User> selectUsers(@Param("page") Page page, @Param("text") String text);
}
